package com.yunhe.policyfulfillment.policyful.service;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.policyfulfillment.authority.model.AppealAndSatisfaction;
import com.yunhe.policyfulfillment.policyful.domain.Appeal;
import com.yunhe.policyfulfillment.policyful.model.*;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * @ClassName: AppealService
 * @Description:
 * @author: GongDaCheng
 * @Date: 14:29 2021/8/24
 */
public interface AppealService {

    /**
     * @Description新增诉求
     * @Param Appeal appeal
     * @Return int
     * @Date 2021/8/24 14:31
     */
    int createAppeal(AppealVO appealVO) throws ArgumentErrorException;

    /**
     * @Description 删除诉求
     * @Param int id
     * @Return int
     * @Date 2021/8/24 14:31
     */
    int deleteAppeal(int id) throws ArgumentErrorException;

    /**
     * @Description 更新诉求
     * @Param Appeal appeal
     * @Return int
     * @Date 2021/8/24 14:31
     */
    int updateAppeal(Appeal appeal);

    /**
     * @Description 根据AppealId查询诉求和满意度评价
     * @Param long appealId
     * @Return AppealAndSatisfaction
     * @Date 2021/10/08 18:01
     */
    AppealAndSatisfaction findAppealAndSatisfactionById(long appealId);

    /**
     * @Description 获取诉求统计量
     * @Param
     * @Return AppealStatistic
     * @Date 2021/8/24 17:34
     */
    AppealStatistic getAppealStatistic() throws ParseException;

    /**
     * @Description 根据条件获取诉求
     * @Param AppealCondition appealCondition
     * @Return List<Appeal>
     * @Date 2021/8/25 11:07
     */
    PageResult getAppealByCondition(AppealCondition appealCondition) throws ParseException;

    /**
     * @Description 根据条件获取诉求(门户)
     * @Param AppealCondition appealCondition
     * @Return PageResult
     * @Date 2021/8/30 11:27
     */
    PageResult getAppealByConditionPortal(AppealCondition appealCondition) throws ParseException;

    /**
     * @Description 根据条件获取诉求(个人中心)
     * @Param AppealCondition appealCondition
     * @Return PageResult
     * @Date 2021/8/30 11:27
     */
    PageResult getAppealByConditionPersonalCenter(AppealCondition appealCondition) throws ParseException, ArgumentErrorException;

    /**
     * @Description 公开诉求
     * @Param long id
     * @Return
     * @Date 2021/8/25 17:56
     */
    void publicAppeal(long id);

    /**
     * @Description 分发诉求
     * @Param long appealId, long handleOrg, Date deadLine
     * @Return
     * @Date 2021/8/26 10:05
     */
    void distributeAppeal(long appealId, long handleOrg, Date deadLine) throws ArgumentErrorException;

    /**
     * @Description 后台根据id查看诉求（包括流程状态）
     * @Param long id
     * @Return AppealView
     * @Date 2021/8/26 16:29
     */
    AppealView viewAppealById(long appealId);

    /**
     * @Description 处理诉求（回复、退回、中止）
     * @Param long appealId, String suggest, String targetStatus
     * @Return
     * @Date 2021/8/26 17:10
     */
    void handleAppeal(long appealId, String suggest, String targetStatus) throws ArgumentErrorException;

    /**
     * @Description 诉求催办
     * @Param long appealId
     * @Return
     * @Date 2021/8/27 11:05
     */
    void urgeAppeal(long appealId) throws ArgumentErrorException;

    /**
     * @Description 诉求分布图
     * @Param String timeType(01:年度  02:月度)
     * @Return List<AppealDistributionVO>
     * @Date 2021/10/11 9:40
     */
    List<OrgAppealStatistic> appealDistribution(String timeType);

    /**
     * @Description 诉求处理报表
     * @Param String timeType, String appealState
     * @Return List<AppealStatisticVO>
     * @Date 2021/10/11 14:21
     */
    AppealProcessingReportVO appealProcessingReport(String timeType, String appealState);

    /**
     * @Description 诉求处理时效统计
     * @Param String timeType
     * @Return List<AppealProcessingEfficiency>
     * @Date 2021/10/12 15:19
     */
    List<AppealProcessingEfficiency> appealProcessingEfficiency(String timeType) throws ParseException;
}
